<%@page import="entities.AdsenseAdv"%>
<%@page import="java.util.TreeMap"%>
<%@page import="helpers.UrlHelper"%>

<%
TreeMap<String, String> check = (TreeMap<String, String>) request.getAttribute("check");
AdsenseAdv ads = (AdsenseAdv) request.getAttribute("ads");
String name = (String) request.getAttribute("name");
String success = (String) request.getAttribute("success");
%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<jsp:include page="/admin/layouts/header.jsp" />
		
<script type="text/javascript" src="/admin/js/custom/adv_form.js"></script>
<script type="text/javascript">
<!--
var name = "<%=name%>";
//-->
</script>
		
					<!-- Content Area -->
                	<div id="da-content-area">
                		<% if (success != null) { %>
                		<div class="grid_4">
                        	<div class="da-panel">
                                <div class="da-panel-content">
                                    <div class="da-message success">
                                        <%=success %>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <% } %>
                        
                		<div class="grid_4">
                        	<div class="da-panel">
                            	<div class="da-panel-header">
                                	<span class="da-panel-title">
                                        <img src="/admin/images/icons/black/16/pencil.png" alt="" />
                                        Size <%=name %>
                                    </span>
                                </div>
                                
                                <form class="da-form" method="post">
	                                <div class="da-panel-content">
	                                	<div class="da-form-inline">
	                                    		<div class="da-form-row">
	                                                <label>Name <span class="required">*</span></label>
	                                                <div class="da-form-item">
	                                                    <input type="text" name="name" value="<%=ads.getName() %>" class="<%=check.get("name") != null ? "error" : "" %>"/>
	                                                    <% if (check.get("name") != null) { %>
	                                                    <span class="errorMessage"><%=check.get("name") %></span>
	                                                    <% } %>
	                                                </div>
	                                            </div>
	                                            
	                                            <div class="da-form-row">
	                                                <label>Content <span class="required">*</span></label>
	                                                <div class="da-form-item large">
	                                                     <textarea cols="auto" rows="auto" name="content" class="<%=check.get("content") != null ? "error" : "" %>" ><%=ads.getContent() %></textarea>
	                                                    <% if (check.get("content") != null) { %>
	                                                    <span class="errorMessage"><%=check.get("content") %></span>
	                                                    <% } %>
	                                                </div>
	                                            </div>
	                                            
	                                            <div class="da-button-row">
			                                   	<input type="submit" value="Submit" class="da-button blue left" />
			                                	<input type="reset" value="Reset" class="da-button gray" />
			                                </div>
	                                    </div>
	                                	
	                                </div>
                                </form>
                                
                                
                            </div>
                        </div>
                        
                	</div>

<jsp:include page="/admin/layouts/footer.jsp" />